// 菜单数据管理模块
import { constantRoutes } from '@/router'
export default {
  namespaced: true,
  state: {
    // 先以静态路由表作为菜单数据的初始值
    list: [...constantRoutes]
  },
  mutations: {
    // 有了动态筛选到的路由表之后 调用函数加入list
    setMenuList(state, asyncFilterRoutes) {
      // 动态路由和静态路由组合起来
      state.list = [...constantRoutes, ...asyncFilterRoutes]
    }
  }
}
